package com.student.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
//import redis.clients.jedis.JedisCluster;


/**
 * @author Andy
 * @date 2022/3/10 9:26
 */
@RestController
@RequestMapping("/cluster")
public class ClusterRedisTest {

//    @Autowired
//    private JedisCluster jedisCluster;
    //andy test

    @Autowired
    private RedisTemplate<String,Object> redisTemplate;

    @GetMapping
    public String addClusterMassage(@RequestParam String key,@RequestParam String value){
        redisTemplate.opsForValue().set(key,value);
        Object s = redisTemplate.opsForValue().get(key);
        System.out.println(s);
        return s.toString();
    }




}
